﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using personalplaner.gui.mainview.viewmodels;
using personalplaner.business.dienstplan.plancollection;
using personalplaner.common.controls;
using personalplaner.gui.plugins.dienstplan.viewmodels;

namespace personalplaner.gui.plugins.dienstplan.views
{
	/// <summary>
	/// Interaction logic for PrintView.xaml
	/// </summary>
    public partial class PrintView : BaseControl
	{
		public PrintView()
		{
            //Loaded += new RoutedEventHandler(PrintView_Loaded);
			InitializeComponent();
		}

		public PrintView(DienstPlanCollection plan)
		{
            //Loaded += new RoutedEventHandler(PrintView_Loaded);
			InitializeComponent();

			Plan = plan;
		}

        //void PrintView_Loaded(object sender, RoutedEventArgs e)
        //{
        //    var dc = DataContext as PrintViewViewModel;

        //    if (dc == null)
        //        return;

        //    dc.Loaded();
        //}

		public DienstPlanCollection Plan
		{
			get {
				var dc = DataContext as PrintViewViewModel;

				if (dc == null)
					return null;

				return dc.Plan; 
			}
			set
			{
				var dc = DataContext as PrintViewViewModel;

				if (dc == null)
					return;

				dc.Plan = value;
			}
		}
	}
}
